package com.cloudbroker.bcs.platform.ltb.bizapi.constants.status;

public enum PublicStatus {
    
    HIDE(0, "隐藏"),
    
    PUBLIC(1, "公开"),
    
    ;
    
    private final int val;
    
    private final String description;
    
    private String toString;
    
    private PublicStatus(int val, String description) {
        this.val = val;
        this.description = description;
    }
    
    public int getVal() {
        return val;
    }
    
    public String getDescription() {
        return description;
    }
    
    public static String getDescription(int realVal) {
        for (PublicStatus s : PublicStatus.values()) {
            if (s.getVal() == realVal) {
                return s.getDescription();
            }
        }
        return String.valueOf(realVal);
    }
    
    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("ClientStatus[").append(val).append(':').append(description)
                    .append(']').toString();
        }
        return toString;
    }
    
}
